# define a commom interface of get an existed dataset
# 
# Author: guochun
###############################################################################

getData=function(filename){
	stringend=substr(filename,nchar(filename)-2,nchar(filename))
	preloc="./objects/data/"
	#only for bci soil data
	if(stringend=="dbf"){
		library(foreign)
		da=read.dbf(paste(preloc,filename,sep=""))
		da=matrix(da[,2],nrow=121,ncol=246,byrow=T)
		data=da[sort(1:121,decreasing=T),]
	}else{
		data=read.table(paste(preloc,filename,sep=""),header=T,stringsAsFactors=F)
	}
	
	return(data)
}

getBCIData=function(filename){
	
}


